package com.freeze.demo.blockchain;

/**
 * <p>Title: Main</p>
 * <p>Description: </p>
 * @author he_jiebing@jiuyv.com
   @date   2021年4月9日 下午1:10:47
 */

public class Main {
	
	public static void main(String[] args) {
		// Review: 补充了 main 中的内容。
		BlockChain blockchain = new BlockChain();
		long num_1 = 0L;
		String str_1 = "begin block";
		blockchain.newTransaction("bob", "alice", 120);
		Block block_1 = new Block(); 
		block_1 = blockchain.newBlock(num_1, str_1);

		System.out.println(blockchain.toString());
		System.out.println("-------------------------");
		blockchain.newTransaction("alice", "zhang", 50);
		System.out.println(blockchain.toString());
		System.out.println("-------------------------");
		String block_1_hash = new String();
		block_1_hash = blockchain.hash(block_1);
		Block block_2 = new Block(); 
		block_2 = blockchain.newBlock(num_1, block_1_hash);
		System.out.println(blockchain.toString());


	}

}
